
<div id="main">
  
  <% if flash[:notice] %>
    <div> <%=h flash[:notice] %> </div>
  <% end %>
  
  <div>
    <h2>Books I Have</h2>
    <p>Here is a list of the books you have added to Book Trader for sharing.</p>
    <ul>
      <% for book in @ownedBooks %>
        <li><%= link_to h(book.title), :controller => "book", :action => "show", :id => book.id%>  <%= h(book.isbn) %>   </li>
      <% end %>
    </ul>
     <%= link_to("Add a Book that you own", :controller => "book", :action => "new", :wanted => false)%>
  </div>
  
  <div>
    <h2>Books I Need</h2>
    <p>Here are the books that you need from other students.</p>
    <ul>
      <% for book in @wantedBooks %>
        <li> <%= link_to h(book.title), :controller => "book", :action => "show", :id => book.id%></li>
      <% end %>
    </ul>
    <%= link_to("Add a Book that you need", :controller => "book", :action => "new")%>
  </div>
  
</div>

<div id="sub">
  <div>
    <h3>User Menu</h3>
    <ul>
      <li><%= link_to("My Books", :controller => "user", :action => "mybooks")%></li>
      <li><%= link_to("Add a Book", :controller => "book", :action => "new")%></li>
      <li><%= link_to("Match Maker", :controller => "user", :action => "mymatch")%></li>
      <li><%= link_to("My Offers", :controller => "user", :action => "offers")%></li>
    </ul>
  </div>
  
</div>

